package com.hzqy.service.industry.medical;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.hzqy.persistence.dao.industry.IndustryMedicalDao;
import com.hzqy.service.core.GenericServiceBean;
import com.hzqy.service.externalLink.ExternalLinkServiceBean;
import com.hzqy.web.vo.WlContentVo;
import com.hzqy.web.vo.industry.medical.IndustryMedicalDataVo;
import com.hzqy.web.vo.weather.WeatherForecastCommonVo;

@Service
public class IndustryMedicalServiceBean extends GenericServiceBean<IndustryMedicalDataVo, IndustryMedicalDao, Integer>{

	private static final long serialVersionUID = 1L;
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	@Resource
	private IndustryMedicalDao industryMedicalDao;
	@Resource
	private ExternalLinkServiceBean externalLinkServiceBean;
	
	@Override
	public IndustryMedicalDao getEntityDao() {
		return industryMedicalDao;
	}
	public List<IndustryMedicalDataVo> selectIndustryMedicalDeviceData(IndustryMedicalDataVo industryMedicalDataVo) {
		WlContentVo wlContentVo = new WlContentVo();
		wlContentVo.setF_wlc_path("https://zjjt.hl.zjip.com/smart/home/iot/deviceInfo");
		wlContentVo.setSysConfigKey("control_link_ab");
		WlContentVo wlc = externalLinkServiceBean.selectWLContentAvaliable(wlContentVo);//是否可以访问
		List<IndustryMedicalDataVo> voList = null;
		if(wlc!=null){
			voList = industryMedicalDao.selectIndustryMedicalDeviceData(industryMedicalDataVo);
		}
		if(null == voList || voList.size() ==0 ){
			voList = new ArrayList<IndustryMedicalDataVo>();
		}
		return voList;
	}
	
}
